/*
 * @Author       : 邱狮杰
 * @Date         : 2021-05-07 15:00:46
 * @LastEditTime : 2021-05-07 15:12:16
 * @FilePath     : /abc/js/index.js
 * @Description  :
 */
$(function () {
  // 考试服务 click function
  $('.examService').click(() => {
    const curOptionList = $('.options')
    const CurImg = $('.examService img')
    const CurSpan = $('.examService span')
    const CurPersonalServiceBtnSpan = $('.personalServiceBtn span')
    if ($('.personalService').hasClass('move')) {
      $('.personalService').removeClass('move').attr('src', './assets/usr.png')
      CurPersonalServiceBtnSpan.css('color', '#bfbfbf')
    }
    if (!CurImg.hasClass('move')) {
      curOptionList.css('height', curOptionList[0].scrollHeight + 'px')
      CurImg.attr('src', './assets/littleHat.png').addClass('move')
      CurSpan.css('color', '#2bb8b5')
    } else {
      CurImg.attr('src', './assets/examination.png').removeClass('move')
      curOptionList.css('height', 0)
      CurSpan.css('color', '#bfbfbf')
    }
  })
  // 个人服务  click function
  $('.personalServiceBtn').click(() => {
    const curOptionList = $('.options')
    const CurImg = $('.personalService')
    const CurSpan = $('.personalServiceBtn span')
    const CurExamServiceSpan = $('.examService span')
    if ($('.examService img').hasClass('move')) {
      $('.examService img').removeClass('move').attr('src', './assets/examination.png')
      curOptionList.css('height', 0)
      CurExamServiceSpan.css('color', '#bfbfbf')
    }
    if (!CurImg.hasClass('move')) {
      CurImg.attr('src', './assets/userBtn.png').addClass('move')
      CurSpan.css('color', '#2bb8b5')
    } else {
      CurImg.attr('src', './assets/usr.png').removeClass('move')
      CurSpan.css('color', '#bfbfbf')
    }
  })
  $('.options').click(e => {
    console.log(e.target.textContent)
  })
})
